/**
 * 
 */
package com.wuka.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.wuka.model.User;
import com.wuka.service.IUserService;

/**
 * Mybatis集成测试类
 * @author zhangliping
 *
 */
@RestController
public class MyBatisController {
	
	private Logger logger = Logger.getLogger(MyBatisController.class);
	 
    @Autowired
    private IUserService userService;
 
    /*
     *  http://localhost:8080/TestManage/getUserInfo
     */
    @RequestMapping(value="/getUserInfo", method = RequestMethod.GET)
    @ResponseBody
	public User getUserInfo() {
		User user = userService.getUserInfo();
		if (user != null) {
			System.out.println("user.getName():" + user.getName());
			logger.info("user.getAge():" + user.getAge());
		}
		return user;
	}
}
